# -*- encoding=utf8 -*-
__author__ = "Administrator"

from airtest.core.api import *
from airtest.cli.parser import cli_setup

if not cli_setup():
    auto_setup(__file__, logdir=True, devices=["android://127.0.0.1:5037/c9a55ee3?cap_method=ADBCAP&touch_method=MAXTOUCH&",]) # xiaomi
    #auto_setup(__file__, logdir=True, devices=["android://127.0.0.1:5037/472eedaa?cap_method=ADBCAP&touch_method=MAXTOUCH&",]) # oppo


# script content
print("start...")
for i in range(5):

    if exists(Template(r"tpl1750226498041.png", record_pos=(0.024, -0.202), resolution=(1080, 2340))):
        touch(Template(r"tpl1750226520949.png", record_pos=(0.36, -0.201), resolution=(1080, 2340)))
    sleep(31.0)
    touch(Template(r"tpl1750226608453.png", record_pos=(-0.194, -0.906), resolution=(1080, 2340)))
    sleep(1.0)


# keyevent("BACK")


# generate html report
# from airtest.report.report import simple_report
# simple_report(__file__, logpath=True)